<Query Kind="Statements">
  <NuGetReference>SharpSvn</NuGetReference>
  <Namespace>SharpSvn</Namespace>
  <Namespace>System.Collections.ObjectModel</Namespace>
  <Namespace>SharpSvn.Security</Namespace>
  <Namespace>System.Net</Namespace>
</Query>

using SvnClient client = new SvnClient();
NetworkCredential _credential = new NetworkCredential("Administrator", "sicont_server");
client.Authentication.Clear();
client.Authentication.DefaultCredentials = _credential;
client.Authentication.SslServerTrustHandlers += (sender, e) =>
{
    e.AcceptedFailures = e.Failures;
    e.Save = true;
};

SvnUriTarget _root = new Uri("https://Vc2000/svn/TestNew");
SvnListArgs _args = new() { Depth = SvnDepth.Infinity };
client.GetList(_root, _args, out Collection<SvnListEventArgs> _list);

SvnUriTarget _target = new Uri("https://vc2000/svn/TestNew/2025_客户1_项目1/");
client.GetInfo(_target, out SvnInfoEventArgs _svn_info);
PrintName(_target, 0);

_target.Uri.ToString().Dump();

void PrintName(SvnUriTarget _target, int _count = 0)
{
    SvnListArgs _args = new() { Depth = SvnDepth.Children };
    client.GetList(_target, _args, out Collection<SvnListEventArgs> _list);

    foreach (var element in _list.Skip(1))
    {
        if (element.Entry.NodeKind is SvnNodeKind.Directory)
        {
            Console.WriteLine($"{new string(' ', _count)} * {element.Name}");
            PrintName(element.Uri, _count + 8);
        }
        else if (element.Entry.NodeKind is SvnNodeKind.File)
        {
            Console.WriteLine($"{new string(' ', _count)} - {element.Name}");
        }
    }
}

